Segment

A segment of the progress bar, which defines its length and color. Segments allow for creating progress bars with multiple colors or sections to represent different stages or categories of progress. For example, Traffic conditions along a navigation journey.

Constructors

Link copied to clipboard
constructor(@IntRange(from = 1) length: Int)
Create a segment with a non-zero length.

Functions

Link copied to clipboard
open fun getColor(): Int
Returns the color of this Segment.
Link copied to clipboard
open fun getId(): Int
Gets the id of this Segment.
Link copied to clipboard
@IntRange(from = 1)
open fun getLength(): Int
The length of this Segment within the progress bar.
Link copied to clipboard
@NonNull
open fun setColor(@ColorInt color: Int): @NonNull NotificationCompat.ProgressStyle.Segment
Optional color of this Segment
Link copied to clipboard
@NonNull
open fun setId(id: Int): @NonNull NotificationCompat.ProgressStyle.Segment
Optional ID used to uniquely identify the element across updates.